package Component;

our $dependencies_key = "__COMPONENT__DEPENDENCIES__";


# Returns the dependencies list
# Before that, if arguments are given, adds dependencies to the component
sub dependencies{
    my $self = shift;
    
    my @new_dependencies = @_;
    
    my $current_dependencies = $self->{$dependencies_key};

    if(scalar(@new_dependencies) > 0){ 
	if(!defined($current_dependencies)){
	    $self->{$dependencies_key} = \@new_dependencies;
	    $current_dependencies = $self->{$dependencies_key};
	}else{
	    push (@{$current_dependencies}, @new_dependencies);
	}
    }
    
    return $current_dependencies;
    
}

1;
